package hjw.com.service;

import hjw.com.dao.TypeMapper;
import hjw.com.entity.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>Project:Academic - TypeServiceImpl
 *
 * @author IvanWei玮 -- maste
 * @version 1.0
 * @DataTime 2025/1/21 19:45
 * @since 1.8
 */
@Service
public class TypeServiceImpl implements TypeService{
    private final TypeMapper typeMapper;

    @Autowired
    public TypeServiceImpl(TypeMapper typeMapper) {
        this.typeMapper = typeMapper;
    }
    @Override
    public List<Type> findAllByCategory() {
        return typeMapper.findAllByCategory();
    }

    @Override
    public List<Type> findAllByType() {
        return typeMapper.findAllByType();
    }

    @Override
    public Type findOneById(Integer id) {
        return typeMapper.findOneById(id);
    }

    @Override
    public int updateById(Map<String, Object> map) {
        return typeMapper.updateById(map);
    }

    @Override
    public int add(Map<String, Object> map) {
        return typeMapper.add(map);
    }

    @Override
    public int delete(Integer id) {
        return typeMapper.delete(id);
    }
}
